package com.ceuer.pet.entity;

import com.ceuer.pet.common.Common;

//宠物对象
public class Pet {
	private Integer id;//宠物id
	// private Integer breedid;//宠物品种id
	private String nickname;//宠物昵称
	private Integer age;//宠物年龄
	private Integer sex;//宠物性别(1:雄性;2:雌性)
	private String remrk;//备注
	private String createtime;//创建时间
	private Integer createuser;//创建人id
	private Integer owner;//领养人id
	private String ownertime;//领养时间
	//以下是非数据库映射属性---字段
	private String sexName;//自定义---性别名称
	private Breed breed;//宠物品种对象
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("Pet [");
		if (id != null)
			sb.append("            id=").append(id).append(",");
		if (nickname != null)
			sb.append("            nickname='").append(nickname).append("',");
		if (age != null)
			sb.append("            age=").append(age).append(",");
		if (sex != null)
			sb.append("            sex=").append(sex).append(",");
		if (remrk != null)
			sb.append("            remrk='").append(remrk).append("',");
		if (createtime != null)
			sb.append("            createtime='").append(createtime).append("',");
		if (createuser != null)
			sb.append("            createuser=").append(createuser).append(",");
		if (owner != null)
			sb.append("            owner=").append(owner).append(",");
		if (ownertime != null)
			sb.append("            ownertime='").append(ownertime).append("',");
		if (sexName != null)
			sb.append("            sexName='").append(sexName).append("',");
		if (breed != null)
			sb.append("            breed=").append(breed).append(",");
		sb.append("] ");
		sb.append(super.toString());
		return sb.toString();
	}
	
	public Breed getBreed() {
		return breed;
	}
	
	public void setBreed(Breed breed) {
		this.breed = breed;
	}
	
	public String getSexName() {
		return sexName;
	}
	
	public void setSexName(String sexName) {
		this.sexName = sexName;
	}
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getNickname() {
		return nickname;
	}
	
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	
	public Integer getAge() {
		return age;
	}
	
	public void setAge(Integer age) {
		if(age<0) age=0;//封装---添加业务访问限制
		this.age = age;
	}
	
	public Integer getSex() {
		return sex;
	}
	
	public void setSex(Integer sex) {
		this.sex = sex;
		if(this.sex==1){//雄性
			this.sexName= Common.SEX_MALE;
		}else if(this.sex==2){
			this.sexName=Common.SEX_FEMALE;
		}else {
			this.sexName="未知";
		}
	}
	
	public String getRemrk() {
		return remrk;
	}
	
	public void setRemrk(String remrk) {
		this.remrk = remrk;
	}
	
	public String getCreatetime() {
		return createtime;
	}
	
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	
	public Integer getCreateuser() {
		return createuser;
	}
	
	public void setCreateuser(Integer createuser) {
		this.createuser = createuser;
	}
	
	public Integer getOwner() {
		return owner;
	}
	
	public void setOwner(Integer owner) {
		this.owner = owner;
	}
	
	public String getOwnertime() {
		return ownertime;
	}
	
	public void setOwnertime(String ownertime) {
		this.ownertime = ownertime;
	}
}